package my.mall.db.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.time.LocalDateTime;

/**
 * <p>
 * 订单商品表
 * </p>
 *
 * @author fengbo
 * @since 2024-04-22
 */
@TableName("mall_order_goods")
class OrderGoods {

    /**
     * 订单主键
     */
    @TableId("order_id")
    var orderId: Long? = null

    /**
     * 数据更新时间
     */
    var updatedTime: LocalDateTime? = null

    /**
     * 商品主键
     */
    var goodsId: Long? = null

    /**
     * sku主键
     */
    var skuId: Long? = null

    /**
     * 商品名称
     */
    var goodsName: String? = null

    var buyNum: Int? = null

    /**
     * 主图
     */
    var skuImgUrl: String? = null

    /**
     * 商品价格-单位分
     */
    var skuPrice: Int? = null

    /**
     * 商品规格
     */
    var specDetail: String? = null

    companion object {

        const val ORDER_ID : String = "order_id"


        const val UPDATED_TIME : String = "updated_time"


        const val GOODS_ID : String = "goods_id"


        const val SKU_ID : String = "sku_id"


        const val GOODS_NAME : String = "goods_name"


        const val BUY_NUM : String = "buy_num"


        const val SKU_IMG_URL : String = "sku_img_url"


        const val SKU_PRICE : String = "sku_price"


        const val SPEC_DETAIL : String = "spec_detail"

    }

    override fun toString(): String {
        return "OrderGoods{" +
        "orderId=" + orderId +
        ", updatedTime=" + updatedTime +
        ", goodsId=" + goodsId +
        ", skuId=" + skuId +
        ", goodsName=" + goodsName +
        ", buyNum=" + buyNum +
        ", skuImgUrl=" + skuImgUrl +
        ", skuPrice=" + skuPrice +
        ", specDetail=" + specDetail +
        "}"
    }
}
